Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.10-35) unstable; urgency=medium
 .
   * find_sym_ptable typo fix
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.10.orig/h/mingw.defs
+++ gcl-2.6.10/h/mingw.defs
@@ -54,6 +54,8 @@ TCL_LIB_SPEC=
 TCL_DL_LIBS=
 TCL_LIBS=
 
+PWD_CMD=pwd -W
+
 #
 # End h/mingw.defs
 #
--- gcl-2.6.10.orig/makefile
+++ gcl-2.6.10/makefile
@@ -121,8 +121,10 @@ $(MPDIR)/libmport.a:
 $(GMPDIR)/libgmp.a: $(GMPDIR)/Makefile
 	cd $(GMPDIR) && $(MAKE) && rm -f libgmp.a &&  ar qc libgmp.a *.o */*.o
 
+PWD_CMD?=pwd
+
 gmp_all: $(GMPDIR)/Makefile
-	cd $(GMPDIR) && echo '#include <stdio.h>' >> gmp.h && echo "#include \"`pwd`/../h/prelink.h\"" >> gmp.h && $(MAKE) 
+	cd $(GMPDIR) && echo '#include <stdio.h>' >> gmp.h && echo "#include \"`$(PWD_CMD)`/../h/prelink.h\"" >> gmp.h && $(MAKE) 
 	touch $@
 
 $(GMPDIR)/mpn/mul_n.o $(GMPDIR)/mpn/lshift.o $(GMPDIR)/mpn/rshift.o: $(GMPDIR)/Makefile
--- gcl-2.6.10.orig/o/sfaslcoff.c
+++ gcl-2.6.10/o/sfaslcoff.c
@@ -163,12 +163,22 @@ relocate_symbols(struct syment *sym,stru
 
     else if (!sym->n_scnum) {
 
-      if (sym->n.n.n_zeroes)
-	STOP(sym->n.n_name,answ=find_sym_ptable(sym->n.n_name));
+      char c=0,*s;
+
+      if (sym->n.n.n_zeroes) {
+	c=sym->n.n_name[8];
+	sym->n.n_name[8]=0;
+	s=sym->n.n_name;
+      } else
+	s=st1+sym->n.n.n_offset;
+
+      if ((answ=find_sym_ptable(s))) 
+	sym->n_value=answ->address;
       else
-	answ=find_sym_ptable(st1+sym->n.n.n_offset);
+	massert(!fprintf(stderr,"Unrelocated non-local symbol: %s\n",s));
 
-      if (answ) sym->n_value=answ->address;
+      if (c)
+	sym->n.n_name[8]=c;
 
     }
 
--- gcl-2.6.10.orig/o/sfaslmacho.c
+++ gcl-2.6.10/o/sfaslmacho.c
@@ -143,6 +143,8 @@ relocate_symbols(struct nlist *n1,struct
       n->n_value+=start; 
     else if ((nd=find_sym_ptable(st1+n->n_un.n_strx)))
       n->n_value=nd->address; 
+    else if (n->n_type&(N_PEXT|N_EXT))
+      massert(!fprintf(stderr,"Unrelocated non-local symbol: %s\n",st1+n->n_un.n_strx));
 
   return 0;
   
--- gcl-2.6.10.orig/o/unixfsys.c
+++ gcl-2.6.10/o/unixfsys.c
@@ -471,11 +471,26 @@ DEF_ORDINARY("FILE",sKfile,KEYWORD,"");
 /* export these for AXIOM */
 int gcl_putenv(char *s) {return putenv(s);}
 char *gcl_strncpy(char *d,const char *s,size_t z) {return strncpy(d,s,z);}
-uid_t gcl_geteuid(void) {return geteuid();}
-uid_t gcl_getegid(void) {return getegid();}
+#ifdef __MINGW32__ 
+#define uid_t int
+#endif
+uid_t gcl_geteuid(void) {
+#ifndef __MINGW32__ 
+  return geteuid();
+#else
+  return 0;
+#endif
+}
+uid_t gcl_getegid(void) {
+#ifndef __MINGW32__ 
+  return getegid();
+#else
+  return 0;
+#endif
+}
 int gcl_dup2(int o,int n) {return dup2(o,n);}
 char *gcl_gets(char *s,int z) {return fgets(s,z,stdin);}
-int gcl_fputs(const char *s) {int i=fputs(s,stdout);fflush(stdout);return i;}
+int gcl_puts(const char *s) {int i=fputs(s,stdout);fflush(stdout);return i;}
 
 
 DEFUN_NEW("STAT",object,fSstat,SI,1,1,NONE,OO,OO,OO,OO,(object path),"") {
